import request from "@/utils/request";

// 红包
const redpacketApi = {
	// 红包列表
	getlist(data : GetListParams) {
		return request.post<dataResult>({ url: "/api/customer/redpacket/getlist", data });
	},
	// 红包详情
	getdetail(data : GetDetailParams) {
		return request.post<dataResult>({ url: "/api/customer/redpacket/getdetail", data });
	},
	// 领取红包
	claim(data : ClaimParams) {
		return request.post<dataResult>({ url: "/api/customer/redpacket/claim", data });
	},
	// 红包记录
	getrecord(data : GetRecordParams) {
		return request.post<dataResult>({ url: "/api/customer/redpacket/getrecord", data });
	}
};

export default redpacketApi;

interface dataResult {
	data ?: any;
	message : string;
	status : number;
}

//消息列表请求参数
interface GetListParams {
	page : number;
	limit : number;
}

interface GetDetailParams {
	id : number;
}

interface ClaimParams {
	id : number;
}

interface GetRecordParams {
	page : number;
	limit : number;
	red_packet_id : number;
}